package cn.edu.gcu.ssl.goods.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.edu.gcu.ssl.goods.dao.GoodsMapper;
import cn.edu.gcu.ssl.goods.entity.Goods;

@Service
public class GoodsService {
	@Resource
	private GoodsMapper goodsDao;
	
	
	@Transactional(readOnly=true)
	public List<Goods> findList(String type)
	{ 
		return 	goodsDao.findList(type);
	}
	
	
	@Transactional(readOnly=false)
	public boolean insert(Goods goods)
	{
	   if(goodsDao.insert(goods)>0)
	   {
		   return true;
	   }
	   else {
		   return false;
	   }
	}
	
	
	@Transactional(readOnly=false)
	public boolean deleteByPrimaryKey(String id)
	{
	   if(goodsDao.deleteByPrimaryKey(id)>0)
	   {
		   return true;
	   }
	   else {
		   return false;
	   }
	}
	
	
	
}	
		
		
	
		
	
